package com.veer.shop.mapper;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Param;

import com.veer.shop.param.CustomerListParam;
import com.veer.shop.pojo.CustomerAdditional;
import com.veer.shop.pojo.RegisterCustomer;
import com.veer.shop.result.CustomerBaseResult;
import com.veer.shop.result.CustomerResult;

/**
 * 会员数据接口访问层
 * 
 * @author WangBin
 * 2021年1月3日-下午2:30:41
 */
public interface CustomerMapper {
	
	// 查询会员手机号是否已存在
    Integer isPhoneExist(@Param("phone") String phone);

	// 查询会员邮箱是否已存在
    Integer isMailExist(@Param("mail") String mail);
	
	// 注册会员
    Integer register(RegisterCustomer customer);
	
	// 插入会员扩展信息
    Integer insertAdditional(CustomerAdditional customerAdditional);
	
	// 根据会员手机号查询会员信息
    CustomerBaseResult getCustomerByPhone(@Param("phone") String phone);
	
	// 根据ID获取会员信息
    CustomerBaseResult getCustomerById(@Param("customer_id") Integer customerId);
    
    // 获取客户列表
    List<Map<String, Object>> getList(CustomerListParam param);
}